﻿using System.Web.Mvc;
using EFCachingProvider;
using EFCachingProvider.Caching;
using BLL;



namespace Web.Areas.Manager.Controllers
{
    [NoCache]
    [HandleError]
    [UserAuthorize]
    public class Sys_infoController : Controller
    {
        public virtual ActionResult Index()
        {
            InMemoryCache cache = (InMemoryCache)EFCachingProviderConfiguration.DefaultCache;

            ViewData["CacheHits"] = cache.CacheHits;
            ViewData["CacheItemAdds"] = cache.CacheItemAdds;
            ViewData["CacheItemInvalidations"] = cache.CacheItemInvalidations;
            ViewData["CacheMisses"] = cache.CacheMisses;
            ViewData["Count"] = cache.Count;

            ViewData["shooting"] = string.Format("{0:f}", ((double)cache.CacheHits) / (cache.CacheHits + cache.CacheMisses) * 100);

            return View();
        }

    }
}
